const MusicDecoratorFactory = (type:string):ClassDecorator => {
    console.log(type);
    switch (type) {
        case "tank":
            return (target:Function) =>{
                target.prototype.playMusic = ():void => {
                    console.log("播放坦克音乐");
                }
            }
        default:
            return (target:Function) =>{
                target.prototype.playMusic = ():void => {
                    console.log("播放玩家音乐");
                }
            }
    }
}

@MusicDecoratorFactory('tank')
class Tank{}
const t = new Tank();
(<any>t).playMusic();

@MusicDecoratorFactory('player')
class Player{}
const p = new Player();
(<any>p).playMusic();